/* 
 * Written by Filipe Moreira @ 23/10/06
 * Asks for a password and does the testing
 * */
#include<stdio.h>

main(){
	const int password= 3;
	const int z = 5;
	const int top = 100;
	const int bot = 1;
	int x,i;
	i = 1;
	
	while (x!=password || i< z){ 
		printf("Enter the password:");
		scanf("%d",&x);
		if(x<bot || x>top){
			printf("Value out of range. Try again...\n");
		}
		else{
			printf("Password incorrect...\n");
			i ++;
		}
		printf("Number of intents left: %d\n",z-i);
		printf("i == %d\n",i);

	}
	
	if(x==z){
		printf("Can't try any more... Goodbye\n");
	} else {
		printf("Password correct... Welcome....\n");
	}
	return 0;
}

